<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	>
		<h:form>
			<!-- 数据库内线路不存在首端站时，显示 -->
			<p:panelGrid columns="1" style="width:100% !important;"
				rendered="#{lineFaultDetailsController.pmodel.firstSt == null}">
				<f:facet name="header">
					<h:outputText value="评价详情" style="font-size:18px;" />
				</f:facet>
				<f:facet name="actions">
					<p:commandButton style="float:left;" icon="fa fa-chevron-circle-left" 
						onclick="backToReport();" value="返回"/>
				</f:facet>
				<h:outputText value="未找到录波文件" style="color:red;" />
			</p:panelGrid>
			<!-- 数据库内线路存在首端站时，显示 -->
			<p:panel header="评价详情" style="text-align: center;font-size:16px;"
				rendered="#{lineFaultDetailsController.pmodel.firstSt != null}">
				<f:facet name="actions">
					<p:commandButton style="float:left;" icon="fa fa-chevron-circle-left" 
						onclick="backToReport();" value="返回"/>
				</f:facet>
				<!-- 变电站名 -->
				<div class="row">
					<!-- 开始站 -->
					<p:panel styleClass="#{lineFaultDetailsController.singleStation?'ui-g-12 ui-md-12':'ui-g-6 ui-md-6'}"
						style="border:0px;" header="#{lineFaultDetailsController.pmodel.firstSt.substationName}" />
					<!-- 结束站 -->
					<p:panel styleClass="ui-g-6 ui-md-6" rendered="#{!lineFaultDetailsController.singleStation}"
						style="border:0px;" header="#{lineFaultDetailsController.pmodel.secondSt.substationName}" />
				</div>
				<!-- 保护动作信息 -->
				<div class="row">
					<!-- 开始站 -->
					<p:dataTable styleClass="#{lineFaultDetailsController.singleStation?'ui-g-12 ui-md-12':'ui-g-6 ui-md-6'}"
						value="#{lineFaultDetailsController.firstActList}" var="item" emptyMessage="无保护动作情况">
						<p:column headerText="保护名称">
								#{item.name}
							</p:column>
						<p:column headerText="保护型号">
								#{item.dev_type}
							</p:column>
						<p:column headerText="动作时间">
							<h:outputText rendered="#{item.distance_0_moments_time gt 0}" value="#{item.distance_0_moments_time/1000}ms">
							</h:outputText>
							<h:outputText rendered="#{item.distance_0_moments_time le 0}" value=""/>
						</p:column>
						<p:column headerText="动作情况">
							<h:outputText rendered="#{item.distance_0_moments_time gt 0}" value="#{item.jump_remark}#{item.phase}">
							</h:outputText>
							<h:outputText rendered="#{item.distance_0_moments_time le 0}" style="color:red" value="未检测到跳闸信号"/>
						</p:column>
					</p:dataTable>
					<!-- 结束站 -->
					<p:dataTable styleClass="ui-g-6 ui-md-6" rendered="#{!lineFaultDetailsController.singleStation}"
						 value="#{lineFaultDetailsController.secondActList}"  var="item" emptyMessage="无保护动作情况">
						<p:column headerText="保护名称">
								#{item.name}
							</p:column>
						<p:column headerText="保护型号">
								#{item.dev_type}
							</p:column>
						<p:column headerText="动作时间">
								<h:outputText rendered="#{item.distance_0_moments_time gt 0}"
								 value="#{item.distance_0_moments_time/1000}ms" />
							<h:outputText rendered="#{item.distance_0_moments_time le 0}" value=""/>
							</p:column>
						<p:column headerText="动作情况">
								<h:outputText rendered="#{item.distance_0_moments_time gt 0}" value="#{item.jump_remark}#{item.phase}">
							</h:outputText>
							<h:outputText rendered="#{item.distance_0_moments_time le 0}" style="color:red" value="未检测到跳闸信号"/>
							</p:column>
					</p:dataTable>
				</div>
				<!-- 故障电压 -->
				<div class="row">
					<!-- 开始站 -->
					<p:dataTable styleClass="#{lineFaultDetailsController.singleStation?'ui-g-12 ui-md-12':'ui-g-6 ui-md-6'}"
						value="#{lineFaultDetailsController.pmodel.firstSt.faultVoltageDetailList}" var="item" emptyMessage="无记录">
						<f:facet name="header">
							<h:outputText value="故障电压" />
						</f:facet>
						<p:columnGroup type="header">
							<p:row>
								<p:column rowspan="2" headerText="相别" />
								<p:column colspan="3" headerText="故障前" />
								<p:column colspan="3" headerText="故障后" />
							</p:row>
							<p:row>
								<p:column headerText="第3周波" />
								<p:column headerText="第2周波" />
								<p:column headerText="第1周波" />
								<p:column headerText="第1周波" />
								<p:column headerText="第2周波" />
								<p:column headerText="第3周波" />
							</p:row>
						</p:columnGroup>
						<p:column>
							<h:outputText value="#{'0'.equals(item.phase)?'3Uο':item.phase}" /> 
						</p:column>
						<p:column>
							<h:outputText style="color:green" value="#{item.preValue60}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber> 
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:green" value="#{item.preValue40}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber> 
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:green" value="#{item.preValue20}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue20}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue40}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue60}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
					</p:dataTable>
					<!-- 结束站 -->
					<p:dataTable styleClass="ui-g-6 ui-md-6" rendered="#{!lineFaultDetailsController.singleStation}"
						value="#{lineFaultDetailsController.pmodel.secondSt.faultVoltageDetailList}"
						var="item" emptyMessage="无记录" >
						<f:facet name="header">
							<h:outputText value="故障电压" />
						</f:facet>
						<p:columnGroup type="header">
							<p:row>
								<p:column rowspan="2" headerText="相别" />
								<p:column colspan="3" headerText="故障前" />
								<p:column colspan="3" headerText="故障后" />
							</p:row>
							<p:row>
								<p:column headerText="第3周波" />
								<p:column headerText="第2周波" />
								<p:column headerText="第1周波" />
								<p:column headerText="第1周波" />
								<p:column headerText="第2周波" />
								<p:column headerText="第3周波" />
							</p:row>
						</p:columnGroup>
						<p:column>
							<h:outputText value="#{'0'.equals(item.phase)?'3Uo':item.phase}" /> 
						</p:column>
						<p:column>
							<h:outputText style="color:green" value="#{item.preValue60}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:green" value="#{item.preValue40}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText  style="color:green" value="#{item.preValue20}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue20}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue40}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue60}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
					</p:dataTable>
				</div>
				<!-- 故障电流 -->
				<div class="row">
					<!-- 开始站 -->
					<p:dataTable styleClass="#{lineFaultDetailsController.singleStation?'ui-g-12 ui-md-12':'ui-g-6 ui-md-6'}"
						value="#{lineFaultDetailsController.pmodel.firstSt.faultCurrentDetailList}"
						var="item" emptyMessage="无记录">
						<f:facet name="header">
							<h:outputText value="故障电流" />
						</f:facet>
						<p:columnGroup type="header">
							<p:row>
								<p:column rowspan="2" headerText="相别" />
								<p:column colspan="3" headerText="故障前" />
								<p:column colspan="3" headerText="故障后" />
							</p:row>
							<p:row>
								<p:column headerText="第3周波" />
								<p:column headerText="第2周波" />
								<p:column headerText="第1周波" />
								<p:column headerText="第1周波" />
								<p:column headerText="第2周波" />
								<p:column headerText="第3周波" />
							</p:row>
						</p:columnGroup>
						<p:column>
							<h:outputText value="#{'0'.equals(item.phase)?'3Io':item.phase}" /> 
						</p:column>
						<p:column>
							<h:outputText style="color:green" value="#{item.preValue60}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:green" value="#{item.preValue40}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:green" value="#{item.preValue20}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue20}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue40}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue60}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
					</p:dataTable>
					<!-- 结束站 -->
					<p:dataTable styleClass="ui-g-6 ui-md-6" rendered="#{!lineFaultDetailsController.singleStation}"
						value="#{lineFaultDetailsController.pmodel.secondSt.faultCurrentDetailList}"
						var="item"  emptyMessage="无记录">
						<f:facet name="header">
							<h:outputText value="故障电流" />
						</f:facet>
						<p:columnGroup type="header">
							<p:row>
								<p:column rowspan="2" headerText="相别" />
								<p:column colspan="3" headerText="故障前" />
								<p:column colspan="3" headerText="故障后" />
							</p:row>
							<p:row>
								<p:column headerText="第3周波" />
								<p:column headerText="第2周波" />
								<p:column headerText="第1周波" />
								<p:column headerText="第1周波" />
								<p:column headerText="第2周波" />
								<p:column headerText="第3周波" />
							</p:row>
						</p:columnGroup>
						<p:column>
							<h:outputText value="#{'0'.equals(item.phase)?'3Io':item.phase}" /> 
						</p:column>
						<p:column>
							<h:outputText style="color:green" value="#{item.preValue60}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:green" value="#{item.preValue40}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:green" value="#{item.preValue20}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue20}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue40}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue60}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
					</p:dataTable>
				</div>
				<!-- 非周期分量分析 -->
				<div class="row">
					<!-- 开始站 -->
					<p:dataTable styleClass="#{lineFaultDetailsController.singleStation?'ui-g-12 ui-md-12':'ui-g-6 ui-md-6'}"
						value="#{lineFaultDetailsController.firstDecayingList}" var="item" emptyMessage="无记录">
						<f:facet name="header">非周期分量分析</f:facet>
						<p:column headerText="相别">#{item[0]}</p:column>
						<p:column headerText="衰减直流分量">#{item[1]}</p:column>
						<p:column headerText="衰减时间常量">#{item[2]}</p:column>
					</p:dataTable>
					<!-- 结束站 -->
					<p:dataTable styleClass="ui-g-6 ui-md-6" rendered="#{!lineFaultDetailsController.singleStation}"
						value="#{lineFaultDetailsController.secondDecayingList}" var="item" emptyMessage="无记录">
						<f:facet name="header">非周期分量分析</f:facet>
						<p:column headerText="相别">#{item[0]}</p:column>
						<p:column headerText="衰减直流分量">#{item[1]}</p:column>
						<p:column headerText="衰减时间常量">#{item[2]}</p:column>
					</p:dataTable>
				</div>
				<!-- 差动电流 -->
				<div class="row">
					<p:dataTable styleClass="ui-g-12 ui-md-12 title-center"
						value="#{lineFaultDetailsController.pmodel.diffCurrentDetailList}"
						var="item" emptyMessage="无记录">
						<f:facet name="header">差动电流</f:facet>
						<p:columnGroup type="header">
							<p:row>
								<p:column rowspan="2" headerText="相别" />
								<p:column colspan="3" headerText="故障前" />
								<p:column colspan="3" headerText="故障后" />
							</p:row>
							<p:row>
								<p:column headerText="第3周波" />
								<p:column headerText="第2周波" />
								<p:column headerText="第1周波" />
								<p:column headerText="第1周波" />
								<p:column headerText="第2周波" />
								<p:column headerText="第3周波" />
							</p:row>
						</p:columnGroup>
						<p:column>
							<h:outputText  value="#{item.phase}" />
						</p:column>
						<p:column>
							<h:outputText style="color:green" value="#{item.preValue60}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:green" value="#{item.preValue40}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:green" value="#{item.preValue20}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue20}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue40}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber>
							</h:outputText>
						</p:column>
						<p:column>
							<h:outputText style="color:red" value="#{item.postValue60}" >
								<f:convertNumber pattern="#0.000"></f:convertNumber> 
							</h:outputText>
						</p:column>
					</p:dataTable>
				</div>
			</p:panel>
		</h:form>
</ui:composition>
